package com.queen.restaurant.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.queen.restaurant.dao.TableDao;
import com.queen.restaurant.domain.Table;

@Service
public class TableService {

	@Autowired
	private TableDao tableDao;
	
	public List<Table> getTablesByRestaurantId(String id){
		List<Table> tableList = tableDao.getTablesByRestaurantId(id);
		return tableList;
	}
	
	public void createTable(Table table){
		tableDao.save(table);
	}
	
	public void deleteTableById(int id){
		tableDao.deleteTableById(id);
	}
	
	public void updateTable(Table table){
		tableDao.update(table);
	}
	
	public Table getTableById(String tableId){
		return tableDao.get(tableId);
	}
}
